jQuery.fn.exists = function(){return this.length>0;}

$(document).ready(function(){
   if ($('pre>code').exists()) {
      $('pre>code').addClass('prettyprint linenums');
      $.getScript("https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js?");
   }
});